-
-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automate upgrade using moved
blocks
#81
Conversation
/test all |
/test all |
/test all |
/test all |
} | ||
|
||
|
||
|
||
locals { | ||
deprecated_lifecycle_rule = { | ||
enabled = var.lifecycle_rule_enabled | ||
enabled = var.lifecycle_rule_enabled == true || (var.lifecycle_rule_enabled == null && length(var.lifecycle_configuration_rules) == 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enabled = var.lifecycle_rule_enabled == true || (var.lifecycle_rule_enabled == null && length(var.lifecycle_configuration_rules) == 0) | |
enabled = var.lifecycle_rule_enabled || (var.lifecycle_rule_enabled == null && length(var.lifecycle_configuration_rules) == 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
│ Error: Operation failed
│
│ on variables-deprecated.tf line 82, in locals:
│ 82: enabled = var.lifecycle_rule_enabled || (var.lifecycle_rule_enabled == null && length(var.lifecycle_configuration_rules) == 0)
│ ├────────────────
│ │ var.lifecycle_rule_enabled is null
│
│ Error during operation: argument must not be null.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah interesting, I didn't realize if a var type = bool
that defaulted to null
wouldn't already implicitly resolve to false
. Good to know.
Important Notes
null
force_destroy
at its default value offalse
, and if you have it set totrue
but want extra safety against the S3 bucket being destroyed, set it tofalse
before upgrading).force_destroy_enabled
flag introduced in v0.27.0 has been removedlifecycle_configuration_rules
input was introduced. In that version, you would continue to get the old default lifecycle rule even if you supplied new rules vialifecycle_configuration_rules
. Now, the default behavior is to ignore all the deprecated lifecycle inputs when thelifecycle_configuration_rules
input is not empty, unless you explicitly setlifecycle_rule_enabled
to true.what
moved
block functionality introduced in Terraform 1.3.0nullable = false
for module input variables which have a default value and where null is not a sensible/handled value for the variable.why
null
, closes Support nullable flag for variables with default values #63